function removeDuplicates(nums: number[]): number {
    let length = nums.length,
        j = 0
    for(let i=0;i<length;i++){
        if(i>0&&nums[i]===nums[i-1]){
            continue
        }
        nums[j++]=nums[i]
    }
    return j
};